﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OfflineReport
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            closeChildrenForm();
            frmBaoCaoGiaiNgan frm = new frmBaoCaoGiaiNgan();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            closeChildrenForm();
            frmBaoCaoThuNo frm = new frmBaoCaoThuNo();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        public void closeChildrenForm() 
        {
            foreach (Form f in this.MdiChildren) 
            {
                f.Close();
            }
        }

        private void báoCáoGiảiNgânToolStripMenuItem_Click(object sender, EventArgs e)
        {
            closeChildrenForm();
            frmBaoCaoGiaiNgan frm = new frmBaoCaoGiaiNgan();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void báoCáoThuNợToolStripMenuItem_Click(object sender, EventArgs e)
        {
            closeChildrenForm();
            frmBaoCaoThuNo frm = new frmBaoCaoThuNo();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
